<script setup>
	import {
		onMounted
	} from 'vue';
	import {
		onLaunch
	} from '@dcloudio/uni-app'
	import {
		getCurrentInstance
	} from 'vue';
	import config from './config';
	import {
		getAccessToken
	} from '@/utils/auth';


	// 检查登录状态（仅 H5 端执行）
	const checkLogin = () => {
		if (!getAccessToken()) {
			uni.reLaunch({
				url: '/pages/login/index'
			}); // ✅ 使用 `uni.reLaunch` 代替 `$tab.reLaunch`
		}
	};
	const app = getCurrentInstance().proxy
	onLaunch(() => {

		app.globalData.config = config

		// #ifdef H5
		checkLogin();
		// #endif
	})
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-plus/index.scss";
	@import "vk-uview-ui/index.scss";
	@import '@/static/scss/index.scss';
	
	page {
	  background-color: #f5f7f9 !important;
	}
</style>